
<div class="select-function">
    <form action="" method="post">

        <button class="layui-btn">查询</button>




        <div class="layui-form-item" >
            <label class="layui-form-label">时间段</label>
            <div class="layui-input-block">
                <input type="text" name="starttime" id="date" autocomplete="off" class="layui-input"  value="<? echo date("Y-m-d",strtotime("-1 day"))?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" class="laydate-icon">
            </div>

        </div>



        <div class="layui-form-item" >
            <label class="layui-form-label" style=" width:10px">-</label>
            <div class="layui-input-block" style="margin-left:45px; margin-right: 45px;">
                <input type="text" name="endtime" id="date" autocomplete="off" class="layui-input "  value="<? echo date("Y-m-d") ?>" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" class="">
            </div>
        </div>




        <br class="clearfloat"/>

</div>

<div class="detail-box statistics-box layui-form">



    <h2>

        <?$departmentid=$_REQUEST['department'];?>

        <?$department=select_one_line_all_items($table_Prefix."department","nid = '".$_REQUEST['department']."'");?>

        <?if($departmentid=="全选")
        {
            $departmentstr="";
            $department['name']="全部";
        }
        else{
            $departmentstr="departmentid = '$departmentid' and";
        }
        ;?>







        <?if($department['name']=="")
        {$departmentid="*";}
        ?>


        <?
        $starttime=$_REQUEST['starttime']." 00:00:00";
        $endtime=$_REQUEST['endtime']." 23:59:59";
        ?>


    </h2>











    <div class="layui-form">
        <table class="layui-table">
            <colgroup>
                <col width="150">
                <col>
                <col>
                <col>
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>项目</th>
                <th>内容</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>招生人数</td>
                <td><? echo count_by_item($table_Prefix."member",$departmentstr." applydate <= '$endtime' and applydate >= '$starttime' ");?></td>
            </tr>

            <tr>
                <td>已付款人数</td>
                <td><? echo count_by_item($table_Prefix."member",$departmentstr."  applydate <= '$endtime' and applydate >= '$starttime' and status = '已收款'");?></td>
            </tr>

            <tr>
                <td>未付款人数</td>
                <td><? echo count_by_item($table_Prefix."member",$departmentstr."  applydate <= '$endtime' and applydate >= '$starttime' and status = '未收款'");?></td>
            </tr>


            <tr>
                <td>已收学费</td>
                <td><? echo sum_total($table_Prefix."member","cost",$departmentstr." applydate <= '$endtime' and applydate >= '$starttime' and status = '已收款'");?></td>

            </tr>
            <!--            <tr>-->
            <!--                <td>优惠学费</td>-->
            <!--                <td></td>-->
            <!---->
            <!--            </tr>-->

            <!--            <tr>-->
            <!--                <td>结业人数</td>-->
            <!--                <td></td>-->
            <!---->
            <!--            </tr>-->



            <tr>
                <td>未开收据</td>
                <td><? echo count_by_item($table_Prefix."member",$departmentstr." applydate <= '$endtime' and applydate >= '$starttime' and receipt != '已生成' ");?></td>

            </tr>

            <tr>
                <td>未递交体检表</td>
                <td><? echo count_by_item($table_Prefix."member",$departmentstr." applydate <= '$endtime' and applydate >= '$starttime' and healthform != '已提交' ");?></td>

            </tr>

            </tbody>
        </table>
    </div>







</div>